package org.carota.util;

import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.util.Arrays;

/**
 * @author : AnWen
 * @version :1.0
 * @since : 2023-03-28 9:44
 */
@Slf4j
public class FileUtils {

    /**
     * 删除文件
     * @param filePaths 文件路径
     */
    public static void deleteFiles(String... filePaths) {
        deleteFiles(Arrays.stream(filePaths)
                .map(File::new)
                .toArray(File[]::new));
    }

    public static void deleteFiles(File... files) {
        Arrays.stream(files)
                .filter(File::isFile)
                .filter(File::exists)
                .forEach(File::delete);
    }




}
